﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 立顶申请联系人信息表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_APP_PROCONINFO: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_APP_PROCONINFO()
		{}
		#region Model
		private long _id;
		private long _proid;
		private long _reginfoid;
		private string _conname;
		private string _gender;
		private string _relation;
		private string _corpname;
		private string _telcode;
		private string _tel;
		private string _telsub;
		private string _corpaddr;
		private string _houaddr;
		private string _houtelcode;
		private string _houtel;
		private string _mobile1;
		private string _mobile2;
		private int _isknow;
		private string _commod;
		private string _remark;
		private int _sparefield1;
		private string _sparefield2;
		private string _sparefield3;
		/// <summary>
		/// 主键ID主键ID，唯一
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 立项申请记录ID
		/// </summary>
		[DataMember]
		public long PROID
		{
			get{return _proid;}
			set{
				if ( _proid!= value)
				{
					 _proid = value;
					OnPropertyChanged("PROID");
				}
			}
		}
		/// <summary>
		/// 申请登记记录ID
		/// </summary>
		[DataMember]
		public long REGINFOID
		{
			get{return _reginfoid;}
			set{
				if ( _reginfoid!= value)
				{
					 _reginfoid = value;
					OnPropertyChanged("REGINFOID");
				}
			}
		}
		/// <summary>
		/// 姓名
		/// </summary>
		[DataMember]
		public string CONNAME
		{
			get{return _conname;}
			set{
				if ( _conname!= value)
				{
					 _conname = value;
					OnPropertyChanged("CONNAME");
				}
			}
		}
		/// <summary>
		/// 性别
		/// </summary>
		[DataMember]
		public string GENDER
		{
			get{return _gender;}
			set{
				if ( _gender!= value)
				{
					 _gender = value;
					OnPropertyChanged("GENDER");
				}
			}
		}
		/// <summary>
		/// 关系
		/// </summary>
		[DataMember]
		public string RELATION
		{
			get{return _relation;}
			set{
				if ( _relation!= value)
				{
					 _relation = value;
					OnPropertyChanged("RELATION");
				}
			}
		}
		/// <summary>
		/// 单位
		/// </summary>
		[DataMember]
		public string CORPNAME
		{
			get{return _corpname;}
			set{
				if ( _corpname!= value)
				{
					 _corpname = value;
					OnPropertyChanged("CORPNAME");
				}
			}
		}
		/// <summary>
		/// 单位电话区号
		/// </summary>
		[DataMember]
		public string TELCODE
		{
			get{return _telcode;}
			set{
				if ( _telcode!= value)
				{
					 _telcode = value;
					OnPropertyChanged("TELCODE");
				}
			}
		}
		/// <summary>
		/// 单位电话
		/// </summary>
		[DataMember]
		public string TEL
		{
			get{return _tel;}
			set{
				if ( _tel!= value)
				{
					 _tel = value;
					OnPropertyChanged("TEL");
				}
			}
		}
		/// <summary>
		/// 单位电话分机号
		/// </summary>
		[DataMember]
		public string TELSUB
		{
			get{return _telsub;}
			set{
				if ( _telsub!= value)
				{
					 _telsub = value;
					OnPropertyChanged("TELSUB");
				}
			}
		}
		/// <summary>
		/// 单位地址
		/// </summary>
		[DataMember]
		public string CORPADDR
		{
			get{return _corpaddr;}
			set{
				if ( _corpaddr!= value)
				{
					 _corpaddr = value;
					OnPropertyChanged("CORPADDR");
				}
			}
		}
		/// <summary>
		/// 住宅地址
		/// </summary>
		[DataMember]
		public string HOUADDR
		{
			get{return _houaddr;}
			set{
				if ( _houaddr!= value)
				{
					 _houaddr = value;
					OnPropertyChanged("HOUADDR");
				}
			}
		}
		/// <summary>
		/// 住宅电话区号
		/// </summary>
		[DataMember]
		public string HOUTELCODE
		{
			get{return _houtelcode;}
			set{
				if ( _houtelcode!= value)
				{
					 _houtelcode = value;
					OnPropertyChanged("HOUTELCODE");
				}
			}
		}
		/// <summary>
		/// 住宅电话
		/// </summary>
		[DataMember]
		public string HOUTEL
		{
			get{return _houtel;}
			set{
				if ( _houtel!= value)
				{
					 _houtel = value;
					OnPropertyChanged("HOUTEL");
				}
			}
		}
		/// <summary>
		/// 手机1
		/// </summary>
		[DataMember]
		public string MOBILE1
		{
			get{return _mobile1;}
			set{
				if ( _mobile1!= value)
				{
					 _mobile1 = value;
					OnPropertyChanged("MOBILE1");
				}
			}
		}
		/// <summary>
		/// 手机2
		/// </summary>
		[DataMember]
		public string MOBILE2
		{
			get{return _mobile2;}
			set{
				if ( _mobile2!= value)
				{
					 _mobile2 = value;
					OnPropertyChanged("MOBILE2");
				}
			}
		}
		/// <summary>
		/// 联系人否知悉此项贷款0否，1是
		/// </summary>
		[DataMember]
		public int ISKNOW
		{
			get{return _isknow;}
			set{
				if ( _isknow!= value)
				{
					 _isknow = value;
					OnPropertyChanged("ISKNOW");
				}
			}
		}
		/// <summary>
		/// 建议沟通方式
		/// </summary>
		[DataMember]
		public string COMMOD
		{
			get{return _commod;}
			set{
				if ( _commod!= value)
				{
					 _commod = value;
					OnPropertyChanged("COMMOD");
				}
			}
		}
		/// <summary>
		/// 备注
		/// </summary>
		[DataMember]
		public string REMARK
		{
			get{return _remark;}
			set{
				if ( _remark!= value)
				{
					 _remark = value;
					OnPropertyChanged("REMARK");
				}
			}
		}
		/// <summary>
		/// 预留字段1
		/// </summary>
		[DataMember]
		public int SPAREFIELD1
		{
			get{return _sparefield1;}
			set{
				if ( _sparefield1!= value)
				{
					 _sparefield1 = value;
					OnPropertyChanged("SPAREFIELD1");
				}
			}
		}
		/// <summary>
		/// 预留字段2
		/// </summary>
		[DataMember]
		public string SPAREFIELD2
		{
			get{return _sparefield2;}
			set{
				if ( _sparefield2!= value)
				{
					 _sparefield2 = value;
					OnPropertyChanged("SPAREFIELD2");
				}
			}
		}
		/// <summary>
		/// 预留字段3
		/// </summary>
		[DataMember]
		public string SPAREFIELD3
		{
			get{return _sparefield3;}
			set{
				if ( _sparefield3!= value)
				{
					 _sparefield3 = value;
					OnPropertyChanged("SPAREFIELD3");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

